<?php
if(!defined('InEmpireCMS'))
{
	exit();
}
?>
<?php
$url="<a href=../../../>首页</a>&nbsp;>&nbsp;<a href=../cp/>控制面板</a>&nbsp;>&nbsp;会员注册";
require(ECMS_PATH.'e/data/template/cp_1.php');
$groupid=1;
?>
<div class="dmain_conent">
<style>
.more-info tr td{padding:8px 2px;}
font{padding:3px;}
.subtips,.extend-title{width:90px;background:#E6D6B5;padding:10px;}
.subtips {}
</style>
<script>
function fsubmit(){
	var username=$("#username").val();
	var nickname=$("#nickname").val();
	var password=$("#password").val();
	var repassword=$("#repassword").val();
	var email=$("#email").val();	
	if(!/^[a-zA-Z][a-zA-Z0-9_]{4,18}$/.test(username)){
		alert("用户名必须以字母开头，由数字、字母、还下划线组成");
		$("#username").trigger("focus");
		return false;
	}
	if(nickname.length<1 || nickname.length>15){alert("昵称长度必须在1-16之间！");$("#nickname").trigger("focus");
		return false;
	}
	if(!password){
		alert("密码不能为空");$("#password").trigger("focus");return false;
	}
	if(password.length<5){
		alert("密码长度必须在5位以上");$("#password").trigger("focus");return false;
	}
	if(password!=repassword){alert("两次密码不一致！");$("#password").trigger("focus");
		return false;
	}
	if(!/^[a-zA-Z0-9_.-]+\@[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]{2,3}$/.test(email)){alert("邮箱格式错误");$("#email").trigger("focus");
		return false;
	}
	return true;
}
</script>
<table width='100%' border='0' align='center' cellpadding='3' cellspacing='1' class="tableborder">
  <form name=userinfoform method=post enctype="multipart/form-data" onsubmit="return fsubmit();" action=../../enews/index.php>
    <input type=hidden name=enews value=register>
    <tr class="header"> 
      <td height="25" colspan="2">注册会员</td>
    </tr>
    <tr bgcolor="#EFEFEF"> 
      <td height="25" colspan="2" class="subtitle"><strong>基本信息 
        <input name="groupid" type="hidden" id="groupid" value="<?=$groupid?>">
        </strong></td>
    </tr>
    <tr> 
      <td class="subtips"> <div align='left'><font style="color:red;">*</font>用户名：</div></td>
      <td  bgcolor="#FFFFFF"> <input name='username' type='text' id='username' maxlength='30'>
        </td>
    </tr>
	   <tr> 
      <td  class="subtips"> <div align='left'><font style="color:red;">*</font>昵称：</div></td>
      <td  bgcolor="#FFFFFF"> <input name='nickname' type='text' id='nickname' maxlength='30'>
        </td>
    </tr>
    <tr> 
      <td class="subtips"> <div align='left'><font style="color:red;">*</font>密码：</div></td>
      <td  bgcolor="#FFFFFF"> <input name='password' type='password' size="32" id='password' maxlength='20'>
        </td>
    </tr>
    <tr> 
      <td class="subtips"> <div align='left'><font style="color:red;">*</font>重复密码：</div></td>
      <td  bgcolor="#FFFFFF"> <input name='repassword' type='password' size="32" id='repassword' maxlength='20'>
        </td>
    </tr>
    <tr> 
      <td class="subtips"> <div align='left'><font style="color:red;">*</font>邮箱：</div></td>
      <td bgcolor="#FFFFFF"> <input name='email' type='text' id='email' size="50" maxlength='50'>
        </td>
    </tr>
    <tr> 
      <td  colspan="2" class="subtitle"><strong>其他信息</strong></td>
    </tr>
    <?php	
	@include($formfile);
	?>     
	<?
	if($public_r['regkey_ok'])
	{
	?>
    <tr>
      <td class="subtips">验证码：</td>
      <td height="25" bgcolor="#FFFFFF"><input name="key" type="text" id="key" size="6"> 
        <img src="../../ShowKey/?v=reg"></td>
    </tr>
	<?
	}	
	?>
    <tr> 
      <td height="25" bgcolor="#FFFFFF">&nbsp;</td>
      <td height="25" bgcolor="#FFFFFF"> <input type='submit' name='Submit' value='马上注册'> 
        &nbsp;&nbsp; <input type='button' name='Submit2' value='返回' onclick='history.go(-1)'></td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td height="25" colspan="2">说明：带*项为必填。</td>
    </tr>  
</table>
</form>
</div>
<?php
require(ECMS_PATH.'e/data/template/cp_2.php');
?>